package com.jt;

import com.jt.mapper.DeptMapper;
import com.jt.mapper.DogMapper;
import com.jt.mapper.EmpMapper;
import com.jt.mapper.UserMapper2;
import com.jt.pojo.Dept;
import com.jt.pojo.Dog;
import com.jt.pojo.Emp;
import com.jt.pojo.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
class MybatisDemo1ApplicationTests3 {

    @Autowired
    private EmpMapper empMapper;
    @Autowired
    private DeptMapper deptMapper;

    //完成一对一封装
    @Test
    public void testOneToOne(){
        List<Emp> empList = empMapper.findAll();
        System.out.println(empList);
    }
    //一对多,一个部门中要求获取多个员工
    @Test
    public void testOneToMore(){
        List<Dept> deptList = deptMapper.findAll();
        System.out.println(deptList);
    }


}
